import logging
import os
import sys
import json
import paramiko
# import commands
# from __future__ import unicode_literals
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render, redirect
from django.urls import reverse
# Create your views here.
# et1_req = os.path.join(os.path.abspath(os.path.dirname(__file__)).split('zhang-mock')[0],
#                        "zhang-mock/data/event_template/event_template_1_req.txt")
# et1_rsp = os.path.join(os.path.abspath(os.path.dirname(__file__)).split('zhang-mock')[0],
#                        "zhang-mock/data/event_template/event_template_1_rsp.txt")
# et2_req = os.path.join(os.path.abspath(os.path.dirname(__file__)).split('zhang-mock')[0],
#                        "zhang-mock/data/event_template/event_template_2_req.txt")
# et2_rsp = os.path.join(os.path.abspath(os.path.dirname(__file__)).split('zhang-mock')[0],
#                        "zhang-mock/data/event_template/event_template_2_rsp.txt")
# et3_req = os.path.join(os.path.abspath(os.path.dirname(__file__)).split('zhang-mock')[0],
#                        "zhang-mock/data/event_template/event_template_3_req.txt")
# et3_rsp = os.path.join(os.path.abspath(os.path.dirname(__file__)).split('zhang-mock')[0],
#                        "zhang-mock/data/event_template/event_template_3_rsp.txt")
# et4_req = os.path.join(os.path.abspath(os.path.dirname(__file__)).split('zhang-mock')[0],
#                        "zhang-mock/data/event_template/event_template_4_req.txt")
# et4_rsp = os.path.join(os.path.abspath(os.path.dirname(__file__)).split('zhang-mock')[0],
#                        "zhang-mock/data/event_template/event_template_4_rsp.txt")
# et5_req = os.path.join(os.path.abspath(os.path.dirname(__file__)).split('zhang-mock')[0],
#                        "zhang-mock/data/event_template/event_template_5_req.txt")
# et5_rsp = os.path.join(os.path.abspath(os.path.dirname(__file__)).split('zhang-mock')[0],
#                        "zhang-mock/data/event_template/event_template_5_rsp.txt")

def index(request):

    # path = reverse('star:star')
    # print(path)
    print(sys.platform)
    # body = request.body
    # body_str = body.decode()
    # logging.info(body_str)
    body = {"moblie": "18868831933"}
    data = {"result": "success", "data": body}
    return HttpResponse(json.dumps(data), status=200, content_type='application/json')

def event_template_1(request):
    data = ""


